Research
Security News
Quasar RAT Disguised as an npm Package for Detecting Vulnerabilities in Ethereum Smart Contracts
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
@appium/logger
Advanced tools
@appium/logger is a logging utility designed for use with Appium, a popular open-source tool for automating mobile applications. It provides a simple and consistent way to log messages, errors, and other information, making it easier to debug and maintain Appium scripts.
Basic Logging
This feature allows you to log messages at different levels (info, warn, error). The logger can be customized with different log levels to control the verbosity of the output.
const log = require('@appium/logger').getLogger('example');
log.info('This is an info message');
log.warn('This is a warning message');
log.error('This is an error message');
Custom Logger Configuration
This feature allows you to configure the logger with custom settings, such as log level and transports. In this example, the logger is configured to use the 'debug' level and output to the console with a simple format.
const { getLogger, configure } = require('@appium/logger');
configure({
level: 'debug',
transports: [
new (require('winston')).transports.Console({
format: require('winston').format.simple()
})
]
});
const log = getLogger('custom');
log.debug('This is a debug message');
Child Loggers
This feature allows you to create child loggers that inherit settings from a parent logger. This is useful for organizing logs from different parts of an application.
const log = require('@appium/logger').getLogger('parent');
const childLog = log.child({ module: 'child' });
childLog.info('This is a message from the child logger');
Winston is a versatile logging library for Node.js that supports multiple transports (e.g., console, file, HTTP) and log levels. It is highly configurable and widely used in the Node.js community. Compared to @appium/logger, Winston offers more flexibility and a broader range of features, but it may require more setup and configuration.
Bunyan is a simple and fast JSON logging library for Node.js. It is designed to produce logs in a structured JSON format, making it easy to parse and analyze. Bunyan is similar to @appium/logger in terms of simplicity and ease of use, but it focuses more on JSON output and structured logging.
Pino is a low-overhead logging library for Node.js that is designed for high performance. It produces logs in a JSON format and is known for its speed and efficiency. Pino is similar to @appium/logger in terms of performance and simplicity, but it is optimized for scenarios where logging performance is critical.
Appium's logging functionality
npm install @appium/logger --save
import log from '@appium/logger';
// additional stuff ---------------------------+
// message ----------+ |
// prefix ----+ | |
// level -+ | | |
// v v v v
log.info('fyi', 'I have a kitty cat: %j', myKittyCat);
This module is forked from npmlog under ISC License because the original project has been archived. Please check the npmlog changelog to see the list of former module updates before it was forked.
ISC License
FAQs
A Universal Logger For The Appium Ecosystem
The npm package @appium/logger receives a total of 207,275 weekly downloads. As such, @appium/logger popularity was classified as popular.
We found that @appium/logger demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 4 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
Security News
Research
A supply chain attack on Rspack's npm packages injected cryptomining malware, potentially impacting thousands of developers.
Research
Security News
Socket researchers discovered a malware campaign on npm delivering the Skuld infostealer via typosquatted packages, exposing sensitive data.